package princessWorld;

import java.awt.*;
import processing.core.*;
import processing.opengl.*;

@SuppressWarnings({ "serial", "unused" })
public class PrincessApplication extends PApplet{
		/*
		static GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
		public final static int WIDTH = gd.getDisplayMode().getWidth();
		public final static int HEIGHT = gd.getDisplayMode().getHeight();
		*/
		
		public final static int WIDTH = 800;
		public final static int HEIGHT = 600;
		
		
		public final int BACKGROUNDCOLOR = color(0);
		
		IPrincessInteraction interaction;
		
		IPrincessWorld world;

		public void setup() {
			size(WIDTH, HEIGHT, OPENGL);
			background(BACKGROUNDCOLOR);
			
			interaction = new MouseInteraction();
			interaction.setup(this);
			
			world = new SimplePrincessWorld();
			world.setup(this);
			
			interaction.addPrincessListeners(world);
		}
		
		public void draw() {
			//Handle updates
			interaction.update();
			world.update();
			
			//Handle draw
			background(BACKGROUNDCOLOR);
			
			world.draw();
		}
		
		/***Event handlers***/
		public void mousePressed() {
			  if (mouseButton == LEFT) {
			  } else if (mouseButton == RIGHT) {
			  } else {
			  }
		}
		
		public void mouseReleased()	{		
		}
		
		public void mouseMoved() {
		}
		
		public void mouseDragged() {
		}	
		
		public void keyPressed(){	
		}
		
		public static void main(String[] args) {
			//PApplet.main(new String[] {"--present", princessWorld.PrincessApplication.class.getName()});
			PApplet.main(new String[] {princessWorld.PrincessApplication.class.getName()});
		}
	}